<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function Person(name , age , gender){
            this.name = name;
            this.age = age;
            this.gender = gender;
        }
        //当我们直接在页面中打印一个对象时，事件上是输出的对象的toString()方法的返回值
        //修改Person原型的toString
        Person.prototype.toString = function(){
            return "Person[name="+this.name+",age="+this.age+",gender="+this.gender+"]";
        };
        // 创建Person的实例
        var per = new Person("孙悟空",18,"男");
        var per2 = new Person("猪八戒",28,"男");

        console.log(per);
        console.log(per.__proto__.__proto__)




    </script>
</head>
<body>

</body>
</html>